'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;

  // const checkOwner = app.middleware.checkOwner()

  router.post('/api/login', controller.user.login)
  router.post('/api/register', controller.user.register)

  // url接口  返回前端对应的路由
  // userid = 0  四个路由
  // userid = 1  返回两个路由
  router.get('/api/myUrl', controller.user.myUrl)

  // 
  router.get('/api/findAll', controller.info.findAll)

  router.post('/api/add', controller.info.add)

  router.delete('/api/delete/:id', controller.info.delete)
  router.put('/api/update/:id', controller.info.update)

  router.get('/api/page', controller.info.page)
  router.get('/api/search', controller.info.search)
  router.get('/api/deleteAll/:ids', controller.info.deleteAll)


};
